package com.teampower.idea.action.builder;

import java.util.List;

import net.sf.json.JSONObject;
import com.teampower.idea.base.BaseBuilder;
import com.teampower.idea.pojo.Users;

public class UsersBuilder  extends BaseBuilder{
	
	public static String getAll(List list,int counts){
		Users users = new Users();
		Users u  = new Users();
		JSONObject json = null;
		StringBuffer stringBuffer = new StringBuffer();
		stringBuffer.append("{totalCount:" + counts + ",dataset:[");
		for(int i=0;i<list.size();i++){
			json = JSONObject.fromObject((Users)list.get(i));
			stringBuffer.append(json);
			if (i != (list.size() - 1)) {
				stringBuffer.append(",");
			}
		}
		stringBuffer.append("]}");
		return stringBuffer.toString();
	}

}

